
/**
 * date: 2018年3月2日
 * 
 * [说明]
 * 此代码要运行正常需要修改`ueditor.config.js`
 * 		+ ,autoFloatEnabled:false
 * 		+ ,userData: {
			toolbarInstanceCount: 1,
			toolbarIdGather: {}
		}
 * 		+ 修改`_src/adapter/editor.js`文件,"getHtmlTpl"方法
        	//  add at 2018年3月2日
        	var _obj = {
        		"editorId": this.id,
        		"toolbarId": this.id+'_toolbarbox'
        	};
        	UEDITOR_CONFIG.userData.toolbarIdGather[UEDITOR_CONFIG.userData.toolbarInstanceCount] = _obj;
        	UEDITOR_CONFIG.userData.toolbarInstanceCount++;
 * 实际上不必如此复杂, 更简单的方案, 请查看`temp/js/temp108_UE_UI_Modify.js`文件
 * 
 * 
 */


// var ue = UE.getEditor('editor');
var ue = UE.getEditor('editor', {wordCount:false,elementPathEnabled:false});

/**
 * add at 2018年3月2日
 * 
 * 
 */
setTimeout(function(){
	console.log( '== UEDITOR_CONFIG ==' );
	console.log( UEDITOR_CONFIG.userData.toolbarIdGather );
	console.log( '== UEDITOR_CONFIG ==' );
	
	var toolbarIdGather = UEDITOR_CONFIG.userData.toolbarIdGather;
	
	var toolbarId = toolbarIdGather['1']['toolbarId'];
	var editorId = toolbarIdGather['1']['editorId'];
	
	console.log( 'toolbarId: ',toolbarId );
	var pos = $('#'+editorId).position();
	var zIndex = parseInt($('#'+editorId).css('zIndex'));
	console.log( 'zIndex',$('#'+editorId).css('zIndex') );
	var height = $('#'+toolbarId).height();
	var width = $('#'+toolbarId).width();
	
	console.log('pos: ', pos);
	console.log('height: ', height);
	console.log('width: ', width);

	var bodyBgColor = $('body').css('backgroundColor');
	console.log('bodyBgColor: ', bodyBgColor);
//	$('#'+toolbarId).before('<div style="width:'+width+';height:'+height+';"></div>');
	var appendHtmlStr = '<div style="background-color:'+bodyBgColor+';position:fixed;top:0;left:0;width:100%;height:'+(pos.top)+'px;z-index:'+(zIndex+1)+';"></div>';
	$('body').append( appendHtmlStr );

	
	$('#'+toolbarId).css({
		position:'fixed',
		top: pos.top,
		left: (pos.left),
		height: height,
		width: (width+2),
		zIndex: (zIndex+1),
		backgroundColor: '#fff'
	});
//	$('#editor').css({
//		marginTop: (height+12)
//	});
	$('#editor').css({
		position:'absolute',
		top: (pos.top+height),
		left: pos.left,
	});
	
	console.log('appendHtmlStr: ', appendHtmlStr);
	
	
}, 50);

